﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DAMP.RazorModel
{
    public class DAMP_List : List<DAMP_Item>
    {
        /// <summary>
        /// Return the first item from the List<DAMP_Item>.
        /// </summary>
        public DAMP_Item First
        {
            get
            {
                return this.First();
            }
        }

        /// <summary>
        /// Check if this list has any media items.
        /// </summary>
        public bool Any
        {
            get
            {
                return this.Any();
            }
        }

        /// <summary>
        /// Use the Skip extension method on this list.
        /// </summary>
        /// <param name="count"></param>
        /// <returns></returns>
        public DAMP_List Skip(int count)
        {
            return new DAMP_List(Enumerable.Skip(this, count));
        }

        /// <summary>
        /// Use the Take extension method on this list.
        /// </summary>
        /// <param name="count"></param>
        /// <returns></returns>
        public DAMP_List Take(int count)
        {
            return new DAMP_List(Enumerable.Take(this, count));
        }

        public DAMP_List(IEnumerable<DAMP_Item> items)
        {
            this.AddRange(items.ToList());
        }
    }
}
